package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.service.ProductService;
import org.product.pojo.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping(value = "product")
public class productController {
    @Autowired
    private ProductService productService;
    //商品详情
    @RequestMapping(value = "getProduct")
    public Product getProduct( @RequestBody Product pojo){
        Product product = productService.findById(pojo.getPid());
        return product;
    }

}
